<!DOCTYPE html>
{% block html %}
<html {% if lang %}lang="{{ lang }}"{% endif %} {% if page_id %}id="{{ page_id }}"{% endif %} class="{% for c in page_classes%} {{ c }} {% endfor%}">
{% endblock %}
{% block head %}
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    {% block keywords %}
    <meta name="keywords" content="{{ ', '.join(keywords) }}">
    {% endblock %}
    {% block description %}
    <meta name="description" content="{{ description }}">
    {% endblock %}
    <meta name="generator" content="teedoc">
    <meta name="theme" content="teedoc-plugin-theme-default">
    {% block head_items %}
        {% for item in header_items %}
        {{ item|safe }}
        {% endfor %}
    {% endblock %}
    {% block head_title %}
    <title>{% if title %}{{ title }} - {% endif %}{{ site_name }}</title>
    {% endblock %}
    <script type="text/javascript">js_vars = {{ js_vars|tojson2 }}</script>
    <script type="text/javascript">metadata = {{ metadata|tojson2 }}</script>
</head>
{% endblock %}
{% block body %}
<body class="type_doc">
    {% block navbar %}
    <div id="navbar">
        <div id="navbar_menu">
            <a class="site_title" href="{{ home_url }}">
                {% if logo_url %}
                    <img class="site_logo" src="{{ logo_url }}" alt="{{ logo_alt }}">
                {% endif %}
                {% if navbar_title %}
                    <h2>{{ navbar_title|safe }}</h2>
                {% endif %}
        </a>
            <a id="navbar_menu_btn"></a>
        </div>
        <div id="navbar_items">
            <div>
                {{ navbar_main|safe }}
            </div>
            <div>
                {{ navbar_options|safe }}
                {{ navbar_plugins|safe }}
            </div>
        </div>
    </div>
    {% endblock %}
    <div id="wrapper">
        <div id="sidebar_wrapper">
            <div id="sidebar">
                <div id="sidebar_title">
                    {{ sidebar_title|safe }}
                </div>
                {{ sidebar_items_html|safe }}
            </div>
        </div>
        <div id="article">
            <div id="menu_wrapper">
                <div id="menu">
                </div>
            </div>
            <div id="content_wrapper">
                <div id="content_body">
                    <div id="article_head">
                        <div id="article_title">
                            {% block title %}
                            <h1>{{ article_title }}</h1>
                            {% endblock %}
                        </div>
                        <div id="article_tags">
                            <ul>
                            {% for tag in tags %}
                                <li>{{ tag }}</li>
                            {% endfor %}
                            </ul>
                        </div>
                        <div id="article_info">
                        <div id="article_info_left">
                            <span class="article_author">
                                {% if author %}{{ author }}{% endif %}
                            </span>
                            {% if date %}
                                <span class="article_date" title="{{ _('Last modify date:') + ' ' + date }}">
                                    {{ date }}
                                </span>
                            {% endif %}
                        </div>
                        <div id="article_info_right">
                            {% if show_source %}
                            <div id="source_link">
                                <a href="{{ source_url }}" target="_blank">
                                    {{ show_source }}
                                </a>
                            </div>
                            {% endif %}
                        </div>
                        </div>
                    </div>
                    <div id="article_tools">
                        <span></span>
                        <span id="toc_btn"></span>
                    </div>
                    <div id="update_history">
                        {% if "update" in metadata and metadata["update"]|length > 0 %}
                        {% if "update_open" in metadata and not metadata["update_open"] %}
                        <details>
                        {% else %}
                        <details open>
                        {% endif %}
                            <summary>{{ _('Update history') }}</summary>
                            <div>
                                <table>
                                        <thead>
                                            <tr>
                                                <th>{{ _("Date") }}</th>
                                                <th>{{ _("Version") }}</th>
                                                <th>{{ _("Author") }}</th>
                                                <th>{{ _("Update content") }}</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            {% for item in metadata["update"] %}
                                                <tr>
                                                    <td>{{ item.date }}</td>
                                                    <td>{{ item.version }}</td>
                                                    <td>{{ item.author }}</td>
                                                    <td>
                                                    {% if item.content is iterable and (item.content is not string and item.content is not mapping) %}
                                                        <ul>
                                                        {% for content in item.content %}
                                                            <li>{{ content }}</li>
                                                        {% endfor %}
                                                        </ul>
                                                    {% else %}
                                                        {{ item.content }}
                                                    {% endif %}
                                                    </td>
                                                </tr>
                                            {% endfor %}
                                        </tbody>
                                </table>
                            </div>
                        </details>
                        {% endif %}
                    </div>
                    <div id="article_content">
                        {% block content %}
                            {{ body|safe }}
                        {% endblock %}
                    </div>
                </div>
                <div id="previous_next">
                    <div id="previous">
                        {% if previous%}
                        <a href="{{ previous.url }}">
                            <span class="icon"></span>
                            <span class="label">{{ previous.title }}</span>
                        </a>
                        {% endif %}
                    </div>
                    <div id="next">
                        {% if next%}
                        <a href="{{ next.url }}">
                            <span class="label">{{ next.title }}</span>
                            <span class="icon"></span>
                        </a>
                        {% endif %}
                    </div>
                </div>
                <div id="comments-container"></div>
            </div>
            <div id="toc_wrapper">
                <div id="toc">
                    <div id="toc_content">
                            {{ toc|safe }}
                    </div>
                </div>
            </div>
        </div>
    </div>
    <a id="to_top" href="#"></a>
    <div id="doc_footer">
        <div id="footer">
            <div id="footer_top">
                {{ footer_top|safe }}
            </div>
            <div id="footer_bottom">
                {{ footer_bottom|safe }}
            </div>
        </div>
    </div>
    {% for item in footer_js_items %}
        {{ item|safe }}
    {% endfor %}
</body>
{% endblock %}
</html>
